<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Qt build and test guide</title>
<link rel="stylesheet" type="text/css" href="https://gcc.gnu.org/gcc.css" />
</head>

<body>
<h1>Qt build and test guide</h1>

<p>This page is a guide to building the Qt
application development toolkit as part of GCC integration testing.</p>

<h2>Resource usage</h2>

<p>The Qt distribution, available from Trolltech's site at
<a href="http://ftp.gwdg.de/pub/linux/troll/qt/source/qt-x11-2.3.0.tar.gz">
qt-x11-2.3.0.tar.gz</a>, is an 8.7 MB file.  The uncompressed distribution
comprises 40 MB of source files.  Building the package adds 40 to 75 MB
of object files and executables to this.</p>

<p>Building the entire Qt distribution on a 750 Mhz Pentium III laptop
takes about 40 minutes.</p>

<h2>Prepare</h2>

<p>To prepare the Qt distribution, perform the following:</p>
<ul>
<li>Unpack the file:
    <ul>
    <li><code>tar zxf qt-x11-2.3.0.tar.gz</code>, or</li>
    <li><code>gunzip -c qt-x11-2.3.0.tar.gz | tar xf -</code></li>
    </ul>
</li>
<li>Rename the directory thus created and move to it:
    <ul>
    <li><code>mv qt-x11-2.3.0 qt; cd qt</code></li>
    </ul>
</li>
<li>Define and export environment variables:
    <ul>
    <li><code>PATH</code> should include the <code>bin</code> directory
        of the GCC installation under test.</li>
    <li><code>LD_LIBRARY_PATH</code> should include the <code>lib</code>
        directory of the GCC installation under test.</li>
    <li><code>QTDIR</code> should be the full pathname of the top
        directory of the Qt distribution (the one we just renamed as
        <code>qt</code>).</li>
    </ul>
</li>
</ul>

<h2>Configure</h2>

<p>The configuration file, which on a GNU/Linux system is
<code>configs/linux-g++-shared</code>, the location of the compiler and
libraries and the compiler flags used to build Qt.  By default it uses
compilers found in <code>PATH</code>, shared libraries found using
<code>LD_LIBRARY_PATH</code>, and the compiler flags
<code>-pipe -O2</code>.  You can specify different flags by changing the
values of <code>SYSCONF_CXXFLAGS</code> and <code>SYSCONF_CFLAGS</code>
in the configuration file.</p>

<p>Run the configure script before building the first time or after
modifying the configuration file:</p>

<pre><code>./configure</code></pre>

<p>The configure script waits for input after printing:</p>

<pre><code>This is the Qt Free Edition.

You are licensed to use this software under the terms of either
the Q Public License (QPL) or the GNU General Public License (GPL).

Type 'Q' to view the Q Public License.
Type 'G' to view the GNU General Public License.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.

Do you accept the terms of the license?
</code></pre>

<p>If you invoke <code>configure</code> from a script you can simply have
an input file with the word "yes".</p>
 
<h2>Build</h2>

<p>To build all of Qt, do:</p>

<pre><code>make all</code></pre>

<p>The <code>all</code> target includes several other targets.  You can
build them separately if that's more convenient.</p>

<h2>Testing</h2>

<p>Qt has no automated tests.</p>

<h2>Interoperability testing</h2>

<p>Some of the Qt make targets depend on libraries built for earlier
targets.  Qt can be used to test interoperability of two compilers by
doing the following:</p>
<ul>
  <li>Configure to use one compiler by modifying the configuration file
      or by setting <code>PATH</code> and <code>LD_LIBRARY_PATH</code>
      for that compiler and its libraries.</li>
  <li><code>make src-mod src-mt src-sub</code></li>
  <li>Configure to use a second compiler.</li>
  <li><code>make sub-tools sub-tutorial sub-examples</code></li>
</ul>

<h2>Timing</h2>

<p>Qt has no performance tests.</p>

<h2>Cleanup</h2>

<p>Cleanup (to prepare the directory for a fresh run, e.g.
with another version of the compiler), is done as follows.</p>

<pre><code>make -k clean</code></pre>

</body>
</html>
